<template>
  <base-breadcrumb>
    <template>
      <div class="table-page-search-wrapper">
        <a-card>
          <titleName title="信息详情" />
          <a-form>
            <a-row :gutter="24">
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="名称"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  {{ objFrom.name }}
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="所属单位"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  {{ objFrom.branchComName +'/'+objFrom.projectName  }}
                </a-form-item>
              </a-col>
                <!-- <a-form-item
                  label="所属项目"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  {{ objFrom.projectName }}
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="6"
              >
                <a-form-item
                  label="所属公司"
                  :label-col="{ lg: { span: 6 }, sm: { span: 4 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  {{ objFrom.branchComName }}
                </a-form-item>
              </a-col> -->
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="交底组织人"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 18 }, sm: { span: 17 } }"
                >
                  {{ objFrom.organizer }}
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="交底日期"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 18 }, sm: { span: 17 } }"
                >
                  {{ objFrom.confessDate }}
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="参与人员"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 18 }, sm: { span: 17 } }"
                >
                  {{ objFrom.participants }}
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="当前状态"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 18 }, sm: { span: 17 } }"
                >
                  <!-- {{ objFrom.auditStatus }} -->
                  <span v-if="objFrom.auditStatus === 'DRAFT'">草稿</span>
                  <span v-if="objFrom.auditStatus === 'SUBMITTED'">已提交</span>
                  <span v-if="objFrom.auditStatus === 'PAST'">通过</span>
                  <span v-if="objFrom.auditStatus === 'REJECTED'">驳回</span>
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="填报人"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 18 }, sm: { span: 17 } }"
                >
                  {{ objFrom.creatorName }}
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="填报时间"
                  :label-col="{ lg: { span: 5 }, sm: { span: 5 } }"
                  :wrapper-col="{ lg: { span: 18 }, sm: { span: 17 } }"
                >
                  {{ objFrom.createTime }}
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </a-card>
      </div>
    </template>
    <!-- 附件 -->
    <a-card>
      <titleName title="相关附件" />
      <a-table
        :columns="enclosure"
        :data-source="objFrom.reviewFileInfoVOList"
        :pagination="false"
      >
        <span
          slot="serial"
          slot-scope="text, record, index"
        >{{ index + 1 }}</span>
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a
            :href="
              '/api/ycloud-file-center/oper/download?access_token=' + token + '&fileId=' + record.fileId
            "
          >下载</a>
          <a-divider type="vertical" />
          <a
            :key="record.fileId"
            @click="$filePreview(record)"
          >查看</a>
        </span>
      </a-table>
    </a-card>
    <div class="tool-btns page-btn-right-top">
      <a-button
        type="primary"
        @click="closeForm()"
      >
        关闭
      </a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
import { detailed } from '@/api/businessAffairs/throwMark'
import Vue from 'vue'
const enclosure = [
    {
        title: '序号',
        width: '80px',
        scopedSlots: { customRender: 'serial' }
    },
    {
        title: '附件名称',
        dataIndex: 'fileName'
    },
    {
        title: '附件格式',
        dataIndex: 'suffixName'
    },

    {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
]
export default {
    name: 'a' + Date.now(),
    mounted() {
        this.token = Vue.getAcloudProvider().getAccessToken()
        detailed(this.$route.query.id).then((res) => {
            if (res.code === 200) {
                this.objFrom = res.data
            }
        })
    },
    methods: {
        // 关闭表单
        closeForm() {
            this.$multiTab.close(this.$route.fullpath)
        }
    },
    data() {
        this.enclosure = enclosure
        return {
            objFrom: '',
            token: ''
        }
    }
}
</script>

<style>
</style>